<?php
	/**
	 * 控制器助手
	 * @author cui
	 *
	 */
	class controller_helper extends base
	{
		/**
		 * 去找控制器
		 * Enter description here ...
		 * @param unknown_type $controller
		 * @param unknown_type $data
		 */
		public static function go($controller, $data)
		{
			template::set_template_path($data);

			self::update_role($data);
			self::keys_start();

			$controller->run();
			$controller->display();
		}

		/**
		 * 更新角色
		 * Enter description here ...
		 * @param unknown_type $data
		 */
		private static function update_role($data)
		{
			role::set_role('module');
			role::set_name($data['module_name']);
		}

		/**
		 * 加载快捷键
		 * Enter description here ...
		 */
		private static function keys_start()
		{
			include LIBRARY_PATH . 'keys.php';
		}
	}